package com.cn.wanxi.model;

import java.util.ArrayList;
import java.util.List;

public class ProductModel {
    private String href;
    private String imgHref;
    private String title;
    private String content;


    private String[] hrefs = {"#", "#"};
    private String[] imgHrefs = {"../img/48_j53b.jpg", "../img/47_s4av.jpg"};
    private String[] titles = {"蚂蚁上树蚁上蚁上蚁上蚁上蚁上蚁上", "蚂蚁上树蚁上"};
    private String[] contents = {"粉丝200g, 猪肉馅50克。", "粉丝200g, 猪肉馅50克。粉丝200g, 猪肉馅50克。粉丝200g, 猪肉馅50克。"};

    //只需要存储轮播图的图片地址
    private String[] companyLunBo = {"../img/21_ttlm.jpg",
            "../img/45_935i.jpg",
            "../img/46_mkua.jpg",
            "../img/32_zq2b.jpg",
            "../img/33_6atw.jpg",
            "../img/45_935i (1).jpg",
            "../img/21_ttlm.jpg",
            "../img/21_ttlm.jpg"};
    private List<ProductModel> list = new ArrayList<>();
    private List<ProductModel> companyLunBoList = new ArrayList<>();

    /**
     * 得到公司页面的轮播图片路径
     *
     * @return
     */
    public List<ProductModel> getCompanyLunBoList() {
        for (int i = 0; i < companyLunBo.length; i++) {
            ProductModel productModel = new ProductModel();//创建对象
            productModel.setImgHref(companyLunBo[i]);
            companyLunBoList.add(productModel);//将新闻信息加入到list集合
        }
        return companyLunBoList;

    }

    /***
     * 封装产品集合
     * @return
     */
    public List<ProductModel> getList() {
        for (int i = 0; i < hrefs.length; i++) {
            ProductModel productModel = new ProductModel();//创建对象
            productModel.setHref(hrefs[i]);
            productModel.setImgHref(imgHrefs[i]);
            productModel.setTitle(titles[i]);
            productModel.setContent(contents[i]);
            list.add(productModel);//将新闻信息加入到list集合
        }
        return list;
    }

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public String getImgHref() {
        return imgHref;
    }

    public void setImgHref(String imgHref) {
        this.imgHref = imgHref;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
